import os from "node:os";

export const ARCH_ARM64 = "arm64"
export const ARCH_X64 = "x64"

export const PLATFORM_WIN = "win"
export const PLATFORM_DARWIN = "darwin"
export const PLATFORM_LINUX = "linux"

export function getArch(): string {
    const arch: string = os.arch()
    switch (arch) {
        case "amd64":
            return ARCH_X64
        case "aarch64":
            return ARCH_ARM64
        default:
            return arch
    }
}

export function getPlatform(): string {
    const platform: string = os.platform()
    switch (platform) {
        case "win32":
            return PLATFORM_WIN
        case "darwin":
            return PLATFORM_DARWIN;
        case "linux":
            return PLATFORM_LINUX;
        default:
            return platform
    }
}
